package com.sskj.postar.core.utils;

import com.sskj.postar.core.constant.MailConstant;
import com.sskj.postar.model.Mail;

import java.util.HashMap;
import java.util.Map;

public class MailUtil {
    public static Mail createMail(String sendTo,String identifyingCode) {
        Mail mail = new Mail();
        mail.setTo(new String[]{sendTo});
        mail.setSubject("欢迎注册Postar");
        mail.setTemplateName(MailConstant.RETGISTEREMPLATE);
        Map<String, String> map = new HashMap<>();
        map.put("identifyingCode", identifyingCode);
        map.put("to", mail.getTo()[0]);
        mail.setTemplateModel(map);
        return mail;
    }
}
